<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!doctype html>
<html>
	<head>
		<title>房间资源修改日志</title>
		<base href="<%=basePath%>" />
		<meta charset="utf-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width,initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no" />
		<meta name="renderer" content="webkit">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<link rel="stylesheet" href="layui/css/layui.css" media="all"> <!-- 适应所有设备 -->
		<style type="text/css">
		</style>
	</head>
	<% String nowDay = new SimpleDateFormat("yyyy-MM-dd").format(new Date()); %>
	<body>

		<br />
		<form class="layui-form" onsubmit='return false'>
			<!-- 返回日志信息 -->
			<div class="layui-form-item">
				<div class="layui-input-inline">
					<input type="text" name="adminId" id="adminId" placeholder="管理员ID" autocomplete="off" class="layui-input">
				</div>
				<div class="layui-inline">
					<div class="layui-input-inline">
						<button class="layui-btn layui-btn-normal" data-type="reload" lay-filter="SelectOrder"
							id="SelectOrder" onsubmit='return false'>搜索</button>
					</div>
				</div>
			</div>
		</form>
		
		<table lay-filter="ResourceLog" id="ResourceLog" class="layui-table"/>
		
		<script src="js/jquery.min.js"></script>
		<script src="layui/layui.js" charset="utf-8"></script>
		
        <script>
			layui.use(['form', 'layer', 'table'], function() {
			var form = layui.form;
			var layer = layui.layer;
			var table = layui.table;

				layer.config({
					extend: 'MySkin/style.css'
				});
				/* table.init('PlayerShow'); */

            var tableIns = table.render({
					elem:'#ResourceLog',
					url:'room/queryRoomEditLog',
					method:'post',
					title:'房间资源修改日志',
					even:true,
					id:'AllTable',
					request:{
						pageName:'pageIndex',
						limitName:'pageCount'
					},
					page:{
					limit: 30,
					limits: [10, 20, 30, 40, 50],
					},
					where:{
						adminId : $('#adminId').val(),
					},
					cols:[[
						{field:'adminId',title:'管理员账号',style:'color:red'},
						{field:'gameName',title:'游戏名'},
						{field:'roomId',title:'房间号',templet:'#Type'},
						{field:'event',title:'操作'},
						{field:'result',title:'结果'},
						{field:'timeFormat',title:'操作时间'},
						{field:'ip',title:'ip地址'},
						]],
						response:{
							statusCode : 200
						},
						parseData:function(res){
						console.log(res);
							return{
								"code":res.status,
								"msg":res.message,
								"count":res.count,
								"data":res.data
							};
						}
				});
				//点击搜索按钮根据用户名称查询
				  $('#SelectOrder').on('click', function(){
					table.reload('AllTable',{
						page:{
							cuur:1
						},
						where:{
							adminId : $('#adminId').val()
						}
					})
				});

				//按照当前的状态重载
				setInterval(function(){
	              	table.reload('AllTable', {});
	              },60000);
			});
			</script>
		</body>
	</html>
				